package com.eedi.framework.template.controller.sys.vo.role;

import com.eedi.framework.common.enums.UserTypeEnum;
import com.eedi.framework.common.enums.YesOrNoEnum;
import com.eedi.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

import static com.eedi.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "系统界面 - 角色分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class SysTemplateRolePageReq extends PageParam {

    @Schema(description = "角色名称，模糊匹配", example = "永聚长青")
    private String sysRoleName;

    @Schema(description = "角色标识，模糊匹配", example = "ihosp")
    private String sysRoleCode;

    @Schema(description = "展示状态，参见 YesOrNoEnum 枚举类", example = "1")
    private YesOrNoEnum sysRoleStatus;

    @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    @Schema(description = "用户类型：0 系统端 99 管理端", requiredMode = Schema.RequiredMode.REQUIRED, example = "99")
    @NotNull(message = "用户类型不能为空")
    private UserTypeEnum sysUserType;

}
